package com.taint.asm.core;

import org.objectweb.asm.Opcodes;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.analysis.AnalyzerException;
import org.objectweb.asm.tree.analysis.Interpreter;
import org.objectweb.asm.tree.analysis.SourceValue;
import org.objectweb.asm.tree.analysis.Value;

import java.util.List;

public class DataFlowInterpreter  extends Interpreter<Value> implements Opcodes {
    /**
     * Constructs a new {@link Interpreter}.
     *
     * @param api the ASM API version supported by this interpreter. Must be one of {@link
     *            Opcodes#ASM4}, {@link Opcodes#ASM5}, {@link
     *            Opcodes#ASM6} or {@link Opcodes#ASM7}.
     */
    protected DataFlowInterpreter(int api) {
        super(api);
    }

    @Override
    public Value newValue(Type type) {
        return null;
    }

    @Override
    public Value newOperation(AbstractInsnNode insn) throws AnalyzerException {
        return null;
    }

    @Override
    public Value copyOperation(AbstractInsnNode insn, Value value) throws AnalyzerException {
        //这里做处理？
        return new SourceValue(value.getSize(), insn);
    }

    @Override
    public Value unaryOperation(AbstractInsnNode insn, Value value) throws AnalyzerException {
        return null;
    }

    @Override
    public Value binaryOperation(AbstractInsnNode insn, Value value1, Value value2) throws AnalyzerException {
        return null;
    }

    @Override
    public Value ternaryOperation(AbstractInsnNode insn, Value value1, Value value2, Value value3) throws AnalyzerException {
        return null;
    }

    @Override
    public Value naryOperation(AbstractInsnNode insn, List<? extends Value> values) throws AnalyzerException {
        return null;
    }

    @Override
    public void returnOperation(AbstractInsnNode insn, Value value, Value expected) throws AnalyzerException {

    }

    @Override
    public Value merge(Value value1, Value value2) {
        return null;
    }
}
